home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / error_hn / rdblib / rblogopt.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-04-09  |  8.7 KB  |  265 lines

  1. VERSION 2.00
  2. Begin Form RBLogOptions
  3. BackColor       =   &H00C0C0C0&
  4. Caption         =   "RDBLIB Log Option Settings"
  5. ClientHeight    =   2475
  6. ClientLeft      =   870
  7. ClientTop       =   1485
  8. ClientWidth     =   8130
  9. Height          =   2880
  10. Left            =   810
  11. LinkTopic       =   "Form1"
  12. ScaleHeight     =   2475
  13. ScaleWidth      =   8130
  14. Top             =   1140
  15. Width           =   8250
  16. Begin VideoSoftElastic VSElastic1
  17. Align           =   5  'Fill Container
  18. BevelChildren   =   3  'No Graphical or Elastics
  19. CaptionPos      =   7  'Right Center
  20. ConvInfo        =   RBLOGOPT.FRX:0000
  21. ForeColor       =   &H00FF0000&
  22. Height          =   2475
  23. IntBkg          =   &H00C0C0C0&
  24. Left            =   0
  25. TabIndex        =   6
  26. TagSplit        =   -1  'True
  27. TagWidth        =   2500
  28. Top             =   0
  29. Width           =   8130
  30. Begin TextBox TxtUser
  31. Height          =   375
  32. Left            =   2460
  33. TabIndex        =   3
  34. Tag             =   "User Name|Enter your name"
  35. Text            =   "Text1"
  36. Top             =   1260
  37. Width           =   4875
  38. Begin CommonDialog CMDialog1
  39. Left            =   780
  40. Top             =   240
  41. Begin SSCommand BtnCancel
  42. Caption         =   "Cancel"
  43. Font3D          =   0  'None
  44. Height          =   375
  45. Left            =   4380
  46. TabIndex        =   5
  47. Tag             =   "|Click to exit without savings the new settings"
  48. Top             =   1740
  49. Width           =   1695
  50. Begin VideoSoftElastic FileFindBtn
  51. BevelInner      =   0  'None
  52. BorderWidth     =   2
  53. ConvInfo        =   RBLOGOPT.FRX:000B
  54. CornerColor     =   &H00C0C0C0&
  55. FontBold        =   0   'False
  56. FontItalic      =   0   'False
  57. FontName        =   "MS Sans Serif"
  58. FontSize        =   8.25
  59. FontStrikethru  =   0   'False
  60. FontUnderline   =   0   'False
  61. Height          =   555
  62. IntBkg          =   &H00C0C0C0&
  63. Left            =   7380
  64. Picture         =   RBLOGOPT.FRX:0016
  65. Style           =   3  'Command Button
  66. TabIndex        =   2
  67. Tag             =   "|Click to browse for the directory containing the log file"
  68. Top             =   600
  69. Width           =   555
  70. Begin SSCommand BtnSave
  71. Caption         =   "Save"
  72. Font3D          =   0  'None
  73. Height          =   375
  74. Left            =   2580
  75. TabIndex        =   4
  76. Tag             =   "|Click to save the new settings"
  77. Top             =   1740
  78. Width           =   1695
  79. Begin VideoSoftElastic cMsg
  80. Align           =   2  'Bottom
  81. BevelInner      =   0  'None
  82. BevelOuter      =   1  'Raised
  83. BevelOuterDir   =   1  'Horizontal
  84. BevelOuterWidth =   1
  85. BorderWidth     =   2
  86. ChildSpacing    =   1
  87. ConvInfo        =   RBLOGOPT.FRX:0318
  88. FontBold        =   0   'False
  89. FontItalic      =   0   'False
  90. FontName        =   "MS Sans Serif"
  91. FontSize        =   8.25
  92. FontStrikethru  =   0   'False
  93. FontUnderline   =   0   'False
  94. ForeColor       =   &H00FF0000&
  95. Height          =   255
  96. IntBkg          =   &H00C0C0C0&
  97. Left            =   0
  98. TabIndex        =   7
  99. Top             =   2220
  100. Width           =   8130
  101. Begin TextBox TxtLogFileLoc
  102. Height          =   375
  103. Left            =   2460
  104. TabIndex        =   1
  105. Tag             =   "Location of Log Database|Enter the path where the logging database RDBLOG.MDB exists"
  106. Text            =   "Text1"
  107. Top             =   780
  108. Width           =   4875
  109. Begin SSCheck ChkLogPerfData
  110. Caption         =   "Log Performance Data"
  111. Font3D          =   0  'None
  112. ForeColor       =   &H00FF0000&
  113. Height          =   375
  114. Left            =   2460
  115. TabIndex        =   0
  116. Tag             =   "|Check if you want to log performance data (times)"
  117. Top             =   300
  118. Width           =   4875
  119. Option Explicit
  120. Dim IniFileName$, AppName$, KeyName$, DefaultStr$
  121. Dim nSize%, Numeric%, nDefault, ReturnStr$, NewVal$
  122. Sub BtnCancel_Click ()
  123.     Unload RBLogOptions
  124. End Sub
  125. Sub BtnCancel_GotFocus ()
  126.     cMsg.Caption = RB_StatusMsg((BtnCancel.Tag))
  127. End Sub
  128. Sub BtnCancel_LostFocus ()
  129.     cMsg.Caption = ""
  130. End Sub
  131. Sub BtnSave_Click ()
  132.     On Error GoTo saveerr
  133.     RB_CloseLog
  134.     If TxtUser.Text = "" Then
  135.         Beep
  136.         MsgBox "Please provide your name in the user name field.", MB_ICONINFORMATION, "Set Log Options"
  137.         Exit Sub
  138.     End If
  139.     mousepointer = HOURGLASS
  140.     IniFileName$ = "RDBLOG.INI"        'name of ini file
  141.     AppName$ = "Logging Parameters"     'Name of application or section heading
  142.     KeyName$ = "Database Location"          'Keyword or variable name
  143.     NewVal$ = TxtLogFileLoc.Text
  144.     SaveIni AppName$, IniFileName$, KeyName$, NewVal$
  145.     KeyName$ = "Log Performance Data"          'Keyword or variable name
  146.     If ChkLogPerfData.Value = True Then
  147.         NewVal$ = "True"
  148.     Else
  149.         NewVal$ = "False"
  150.     End If
  151.     SaveIni AppName$, IniFileName$, KeyName$, NewVal$
  152.     KeyName$ = "User Name"          'Keyword or variable name
  153.     NewVal$ = TxtUser.Text
  154.     SaveIni AppName$, IniFileName$, KeyName$, NewVal$
  155.     RB_OpenLog
  156.     mousepointer = DEFAULT
  157.     Unload RBLogOptions
  158.     Exit Sub
  159. saveerr:
  160. End Sub
  161. Sub BtnSave_GotFocus ()
  162.     cMsg.Caption = RB_StatusMsg((BtnSave.Tag))
  163. End Sub
  164. Sub BtnSave_LostFocus ()
  165.     cMsg.Caption = ""
  166. End Sub
  167. Sub ChkLogPerfData_GotFocus ()
  168.     cMsg.Caption = RB_StatusMsg((ChkLogPerfData.Tag))
  169. End Sub
  170. Sub ChkLogPerfData_LostFocus ()
  171.     cMsg.Caption = ""
  172. End Sub
  173. Sub FileFindBtn_Click ()
  174.     Dim erraction As Integer
  175.     On Error GoTo FindFileErr
  176.     CMDialog1.DefaultExt = "*.mdb"
  177.     CMDialog1.DialogTitle = "Select Location of RDB Log Database"
  178.     CMDialog1.Filter = "RDB Log Database|rdblog.mdb|"
  179.     CMDialog1.FilterIndex = 1
  180.     CMDialog1.Flags = OFN_FILEMUSTEXIST Or OFN_PATHMUSTEXIST
  181.     CMDialog1.Action = 1
  182.     TxtLogFileLoc.Text = Left$(CMDialog1.Filename, Len(CMDialog1.Filename) - Len(CMDialog1.Filetitle))
  183.     cMsg.Caption = ""
  184.     Exit Sub
  185. FindFileErr:
  186.     erraction = RB_ErrorHandler("RBLogOptions", "FileFindBtn_Click")
  187.     Select Case erraction
  188.     Case 1
  189.         Resume 0
  190.     Case 2
  191.         Resume Next
  192.     End Select
  193. End Sub
  194. Sub FileFindBtn_GotFocus ()
  195.     cMsg.Caption = RB_StatusMsg((FileFindBtn.Tag))
  196. End Sub
  197. Sub FileFindBtn_LostFocus ()
  198.     cMsg.Caption = ""
  199. End Sub
  200. Sub FldGotFocus (pControl As Control)
  201.      pControl.BackColor = BLUE
  202.      pControl.ForeColor = WHITE
  203.      cMsg.Caption = RB_StatusMsg((pControl.Tag))
  204.      pControl.SelStart = 0
  205.      pControl.SelLength = 1000
  206. End Sub
  207. Sub FldLostFocus (pControl As Control)
  208.     pControl.BackColor = WHITE
  209.     pControl.ForeColor = BLACK
  210.     cMsg.Caption = ""
  211. End Sub
  212. Sub Form_Load ()
  213.     Dim erraction As Integer
  214.     On Error GoTo FormLoadErr
  215.     IniFileName$ = "RDBLOG.INI"        'name of ini file
  216.     AppName$ = "Logging Parameters"     'Name of application or section heading
  217.     KeyName$ = "Database Location"          'Keyword or variable name
  218.     DefaultStr$ = ""            'Default string        (for String variables)
  219.     nSize% = 255                'uncertain - possibly length of fill string
  220.     Numeric% = False               'Tell it we are looking for a string
  221.     ReadIni AppName$, KeyName$, nDefault, DefaultStr$, ReturnStr$, Numeric%, IniFileName$
  222.     TxtLogFileLoc.Text = ReturnStr$
  223.     KeyName$ = "Log Performance Data"          'Keyword or variable name
  224.     DefaultStr$ = ""            'Default string        (for String variables)
  225.     ReadIni AppName$, KeyName$, nDefault, DefaultStr$, ReturnStr$, Numeric%, IniFileName$
  226.     If ReturnStr$ = "True" Then
  227.         ChkLogPerfData.Value = True
  228.     Else
  229.         ChkLogPerfData.Value = False
  230.     End If
  231.     KeyName$ = "User Name"          'Keyword or variable name
  232.     DefaultStr$ = ""            'Default string        (for String variables)
  233.     nSize% = 255                'uncertain - possibly length of fill string
  234.     Numeric% = False               'Tell it we are looking for a string
  235.     ReadIni AppName$, KeyName$, nDefault, DefaultStr$, ReturnStr$, Numeric%, IniFileName$
  236.     TxtUser.Text = ReturnStr$
  237.     Exit Sub
  238. FormLoadErr:
  239.     erraction = RB_ErrorHandler("RBLogOptions", "Form_Load")
  240.     Select Case erraction
  241.     Case 1
  242.         Resume 0
  243.     Case 2
  244.         Resume Next
  245.     End Select
  246. End Sub
  247. Sub TxtLogFileLoc_GotFocus ()
  248.     FldGotFocus TxtLogFileLoc
  249. End Sub
  250. Sub TxtLogFileLoc_LostFocus ()
  251.     FldLostFocus TxtLogFileLoc
  252.     TxtLogFileLoc.Text = UCase$(Trim$(TxtLogFileLoc.Text))
  253.     If RTrim$(TxtLogFileLoc.Text) <> "" Then
  254.         If Right$(TxtLogFileLoc.Text, 1) <> "\" Then
  255.             TxtLogFileLoc.Text = TxtLogFileLoc.Text + "\"
  256.         End If
  257.     End If
  258. End Sub
  259. Sub TxtUser_GotFocus ()
  260.     FldGotFocus TxtUser
  261. End Sub
  262. Sub TxtUser_LostFocus ()
  263.     FldLostFocus TxtUser
  264. End Sub
  265.